package com.winona.ui;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
import android.widget.TextView;

import com.taplinker.client.R;
import com.winona.Base1Activity;
import com.winona.HomeActivity;
import com.winona.bean.Message;
import com.winona.bean.MessageRes;

public class PerToolActivity extends Base1Activity {
	private static final String TAG = "PerToolActivity";
	private TextView title;
	private ImageView back;
	private TextView check;
	private Intent intent;
	private View news, inquiry, weather, test;
	private MessageRes messageRes;

	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.per_tool);
		findView();
		Animation animRef = AnimationUtils.loadAnimation(this, R.anim.anim1);
		title.setText("个人工具");
		setLinstener();
		getData();
	}

	private void getData() {
		
		
	}

	private void setLinstener() {
		back.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				intent = getIntent();
				String value = intent.getExtras().getString("tool");
				if (value.equals("0")) {
					openMenu();
				} else {
					intent = new Intent(PerToolActivity.this,
							HomeActivity.class);
					startActivity(intent);
					overridePendingTransition(R.anim.input, R.anim.out);
				}
			}
		});
		news.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				startActivity(ImportantNewsActivity.class);
			}
		});
		inquiry.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				startActivity(FlyActivity.class);

			}
		});
		test.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				startActivity(SkinTestActivity.class);

			}
		});

	}

	private void findView() {
		
		messageRes=new MessageRes();
		
		title = (TextView) findViewById(R.id.tool_title);
		back = (ImageView) findViewById(R.id.tool_back);
		news = findViewById(R.id.tool_name);
		inquiry = findViewById(R.id.tool_inquiry);
		weather = findViewById(R.id.tool_weather);
		test = findViewById(R.id.tool_test);
		check = (TextView) findViewById(R.id.tool_iv_check);
		Log.d(TAG, "消息数："+messageRes.getCountData());
//		check.setText(messageRes.getCountData());
		
	}
}
